﻿using exercise.链表;

using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
//using System.Collections.Generic;

namespace UnitTestProject1
{
    [TestClass]
    public class LinkTest1
    {
        //反转链表
        [TestMethod]
        public void linkTest()
        {
            // 简写，会自动调用add
            LinkedList<int> linkedList = new LinkedList<int>
            {
                1,
                2,
                3,
                4
            };
            Console.WriteLine("反转前" + string.Join(", ", linkedList) + "\n");
            Console.WriteLine();


            Solution solution = new Solution();
            ListNode<int> result = solution.ReverseList(linkedList.Head);

            Console.WriteLine("反转后的头节点" + result.Value + "\n");
            Console.WriteLine("反转后" + string.Join(", ", linkedList) + "\n");
        }


    }
}
